package com.example.demo.controller;

import com.example.demo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {
    @Autowired
    private Person person;

    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        return "我是"+person.getName()+"年龄:"+person.getAge()+"爱好:";
    }
}
